package com.xiaochuan.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统权限表
 * </p>
 *
 * @author 经典
 * @since 2021-04-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserSysPrivilege对象", description="系统权限表")
public class UserSysPrivilege implements Serializable,Comparable<UserSysPrivilege>{

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "系统权限ID")
    @TableId(value = "privilege_id", type = IdType.AUTO)
    private Integer privilegeId;

    @ApiModelProperty(value = "权限类型")
    private String permission;

    @ApiModelProperty(value = "权限名字")
    private String privilegeName;

    @ApiModelProperty(value = "请求路径")
    private String pathUrl;

    @ApiModelProperty(value = "权限类型（1根节点，2子节点，3是一些操作）")
    private Integer privilegeType;

    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public int compareTo(UserSysPrivilege o) {//排序
        return (this.privilegeId - o.privilegeId);
    }
}
